<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vipcard;

class CardDetailModel {
	
	static $_TSPEC;
	public $userId = null;
	public $faceMoney = null;
	public $validMoney = null;
	public $usedMoney = null;
	public $frozenMoney = null;
	public $expiredMoney = null;
	public $activateTime = null;
	public $startTime = null;
	public $stopTime = null;
	public $isUsed = null;
	public $isFrozen = null;
	public $isExpired = null;
	public $numberId = null;
	public $cardNumber = null;
	public $systemType = null;
	public $fromSource = null;
	public $fromChannel = null;
	public $id = null;
	public $vipcardProductCode = null;
	public $activateCodeEncrypt = null;
	public $sellTime = null;
	public $merchantName = null;
	public $merchantCode = null;
	public $createTime = null;
	public $useEffectDay = null;
	public $groupId = null;
	public $orderSn = null;
	public $activityId = null;
	public $activityNo = null;
	public $cardFlag = null;
	public $purchaserId = null;
	public $status = null;
	public $revokeMoney = null;
	public $activateEndTime = null;
	public $showVipcardStatus = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'userId'
			),
			2 => array(
			'var' => 'faceMoney'
			),
			3 => array(
			'var' => 'validMoney'
			),
			4 => array(
			'var' => 'usedMoney'
			),
			5 => array(
			'var' => 'frozenMoney'
			),
			6 => array(
			'var' => 'expiredMoney'
			),
			7 => array(
			'var' => 'activateTime'
			),
			8 => array(
			'var' => 'startTime'
			),
			9 => array(
			'var' => 'stopTime'
			),
			10 => array(
			'var' => 'isUsed'
			),
			11 => array(
			'var' => 'isFrozen'
			),
			12 => array(
			'var' => 'isExpired'
			),
			13 => array(
			'var' => 'numberId'
			),
			14 => array(
			'var' => 'cardNumber'
			),
			15 => array(
			'var' => 'systemType'
			),
			16 => array(
			'var' => 'fromSource'
			),
			17 => array(
			'var' => 'fromChannel'
			),
			18 => array(
			'var' => 'id'
			),
			19 => array(
			'var' => 'vipcardProductCode'
			),
			20 => array(
			'var' => 'activateCodeEncrypt'
			),
			21 => array(
			'var' => 'sellTime'
			),
			22 => array(
			'var' => 'merchantName'
			),
			23 => array(
			'var' => 'merchantCode'
			),
			24 => array(
			'var' => 'createTime'
			),
			25 => array(
			'var' => 'useEffectDay'
			),
			26 => array(
			'var' => 'groupId'
			),
			27 => array(
			'var' => 'orderSn'
			),
			28 => array(
			'var' => 'activityId'
			),
			29 => array(
			'var' => 'activityNo'
			),
			30 => array(
			'var' => 'cardFlag'
			),
			31 => array(
			'var' => 'purchaserId'
			),
			32 => array(
			'var' => 'status'
			),
			33 => array(
			'var' => 'revokeMoney'
			),
			34 => array(
			'var' => 'activateEndTime'
			),
			35 => array(
			'var' => 'showVipcardStatus'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['userId'])){
				
				$this->userId = $vals['userId'];
			}
			
			
			if (isset($vals['faceMoney'])){
				
				$this->faceMoney = $vals['faceMoney'];
			}
			
			
			if (isset($vals['validMoney'])){
				
				$this->validMoney = $vals['validMoney'];
			}
			
			
			if (isset($vals['usedMoney'])){
				
				$this->usedMoney = $vals['usedMoney'];
			}
			
			
			if (isset($vals['frozenMoney'])){
				
				$this->frozenMoney = $vals['frozenMoney'];
			}
			
			
			if (isset($vals['expiredMoney'])){
				
				$this->expiredMoney = $vals['expiredMoney'];
			}
			
			
			if (isset($vals['activateTime'])){
				
				$this->activateTime = $vals['activateTime'];
			}
			
			
			if (isset($vals['startTime'])){
				
				$this->startTime = $vals['startTime'];
			}
			
			
			if (isset($vals['stopTime'])){
				
				$this->stopTime = $vals['stopTime'];
			}
			
			
			if (isset($vals['isUsed'])){
				
				$this->isUsed = $vals['isUsed'];
			}
			
			
			if (isset($vals['isFrozen'])){
				
				$this->isFrozen = $vals['isFrozen'];
			}
			
			
			if (isset($vals['isExpired'])){
				
				$this->isExpired = $vals['isExpired'];
			}
			
			
			if (isset($vals['numberId'])){
				
				$this->numberId = $vals['numberId'];
			}
			
			
			if (isset($vals['cardNumber'])){
				
				$this->cardNumber = $vals['cardNumber'];
			}
			
			
			if (isset($vals['systemType'])){
				
				$this->systemType = $vals['systemType'];
			}
			
			
			if (isset($vals['fromSource'])){
				
				$this->fromSource = $vals['fromSource'];
			}
			
			
			if (isset($vals['fromChannel'])){
				
				$this->fromChannel = $vals['fromChannel'];
			}
			
			
			if (isset($vals['id'])){
				
				$this->id = $vals['id'];
			}
			
			
			if (isset($vals['vipcardProductCode'])){
				
				$this->vipcardProductCode = $vals['vipcardProductCode'];
			}
			
			
			if (isset($vals['activateCodeEncrypt'])){
				
				$this->activateCodeEncrypt = $vals['activateCodeEncrypt'];
			}
			
			
			if (isset($vals['sellTime'])){
				
				$this->sellTime = $vals['sellTime'];
			}
			
			
			if (isset($vals['merchantName'])){
				
				$this->merchantName = $vals['merchantName'];
			}
			
			
			if (isset($vals['merchantCode'])){
				
				$this->merchantCode = $vals['merchantCode'];
			}
			
			
			if (isset($vals['createTime'])){
				
				$this->createTime = $vals['createTime'];
			}
			
			
			if (isset($vals['useEffectDay'])){
				
				$this->useEffectDay = $vals['useEffectDay'];
			}
			
			
			if (isset($vals['groupId'])){
				
				$this->groupId = $vals['groupId'];
			}
			
			
			if (isset($vals['orderSn'])){
				
				$this->orderSn = $vals['orderSn'];
			}
			
			
			if (isset($vals['activityId'])){
				
				$this->activityId = $vals['activityId'];
			}
			
			
			if (isset($vals['activityNo'])){
				
				$this->activityNo = $vals['activityNo'];
			}
			
			
			if (isset($vals['cardFlag'])){
				
				$this->cardFlag = $vals['cardFlag'];
			}
			
			
			if (isset($vals['purchaserId'])){
				
				$this->purchaserId = $vals['purchaserId'];
			}
			
			
			if (isset($vals['status'])){
				
				$this->status = $vals['status'];
			}
			
			
			if (isset($vals['revokeMoney'])){
				
				$this->revokeMoney = $vals['revokeMoney'];
			}
			
			
			if (isset($vals['activateEndTime'])){
				
				$this->activateEndTime = $vals['activateEndTime'];
			}
			
			
			if (isset($vals['showVipcardStatus'])){
				
				$this->showVipcardStatus = $vals['showVipcardStatus'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'CardDetailModel';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("userId" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->userId); 
				
			}
			
			
			
			
			if ("faceMoney" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->faceMoney);
				
			}
			
			
			
			
			if ("validMoney" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->validMoney);
				
			}
			
			
			
			
			if ("usedMoney" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->usedMoney);
				
			}
			
			
			
			
			if ("frozenMoney" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->frozenMoney);
				
			}
			
			
			
			
			if ("expiredMoney" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->expiredMoney);
				
			}
			
			
			
			
			if ("activateTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->activateTime);
				
			}
			
			
			
			
			if ("startTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->startTime);
				
			}
			
			
			
			
			if ("stopTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->stopTime);
				
			}
			
			
			
			
			if ("isUsed" == $schemeField){
				
				$needSkip = false;
				$input->readBool($this->isUsed);
				
			}
			
			
			
			
			if ("isFrozen" == $schemeField){
				
				$needSkip = false;
				$input->readBool($this->isFrozen);
				
			}
			
			
			
			
			if ("isExpired" == $schemeField){
				
				$needSkip = false;
				$input->readBool($this->isExpired);
				
			}
			
			
			
			
			if ("numberId" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->numberId); 
				
			}
			
			
			
			
			if ("cardNumber" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->cardNumber);
				
			}
			
			
			
			
			if ("systemType" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->systemType); 
				
			}
			
			
			
			
			if ("fromSource" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->fromSource);
				
			}
			
			
			
			
			if ("fromChannel" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->fromChannel);
				
			}
			
			
			
			
			if ("id" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->id); 
				
			}
			
			
			
			
			if ("vipcardProductCode" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->vipcardProductCode); 
				
			}
			
			
			
			
			if ("activateCodeEncrypt" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->activateCodeEncrypt);
				
			}
			
			
			
			
			if ("sellTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->sellTime);
				
			}
			
			
			
			
			if ("merchantName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->merchantName);
				
			}
			
			
			
			
			if ("merchantCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->merchantCode);
				
			}
			
			
			
			
			if ("createTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->createTime);
				
			}
			
			
			
			
			if ("useEffectDay" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->useEffectDay); 
				
			}
			
			
			
			
			if ("groupId" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->groupId); 
				
			}
			
			
			
			
			if ("orderSn" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->orderSn);
				
			}
			
			
			
			
			if ("activityId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->activityId);
				
			}
			
			
			
			
			if ("activityNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->activityNo);
				
			}
			
			
			
			
			if ("cardFlag" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->cardFlag); 
				
			}
			
			
			
			
			if ("purchaserId" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->purchaserId); 
				
			}
			
			
			
			
			if ("status" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->status); 
				
			}
			
			
			
			
			if ("revokeMoney" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->revokeMoney);
				
			}
			
			
			
			
			if ("activateEndTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->activateEndTime);
				
			}
			
			
			
			
			if ("showVipcardStatus" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->showVipcardStatus); 
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->userId !== null) {
			
			$xfer += $output->writeFieldBegin('userId');
			$xfer += $output->writeI64($this->userId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->faceMoney !== null) {
			
			$xfer += $output->writeFieldBegin('faceMoney');
			$xfer += $output->writeString($this->faceMoney);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->validMoney !== null) {
			
			$xfer += $output->writeFieldBegin('validMoney');
			$xfer += $output->writeString($this->validMoney);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->usedMoney !== null) {
			
			$xfer += $output->writeFieldBegin('usedMoney');
			$xfer += $output->writeString($this->usedMoney);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->frozenMoney !== null) {
			
			$xfer += $output->writeFieldBegin('frozenMoney');
			$xfer += $output->writeString($this->frozenMoney);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->expiredMoney !== null) {
			
			$xfer += $output->writeFieldBegin('expiredMoney');
			$xfer += $output->writeString($this->expiredMoney);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->activateTime !== null) {
			
			$xfer += $output->writeFieldBegin('activateTime');
			$xfer += $output->writeI64($this->activateTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->startTime !== null) {
			
			$xfer += $output->writeFieldBegin('startTime');
			$xfer += $output->writeI64($this->startTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->stopTime !== null) {
			
			$xfer += $output->writeFieldBegin('stopTime');
			$xfer += $output->writeI64($this->stopTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->isUsed !== null) {
			
			$xfer += $output->writeFieldBegin('isUsed');
			$xfer += $output->writeBool($this->isUsed);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->isFrozen !== null) {
			
			$xfer += $output->writeFieldBegin('isFrozen');
			$xfer += $output->writeBool($this->isFrozen);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->isExpired !== null) {
			
			$xfer += $output->writeFieldBegin('isExpired');
			$xfer += $output->writeBool($this->isExpired);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->numberId !== null) {
			
			$xfer += $output->writeFieldBegin('numberId');
			$xfer += $output->writeI64($this->numberId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->cardNumber !== null) {
			
			$xfer += $output->writeFieldBegin('cardNumber');
			$xfer += $output->writeString($this->cardNumber);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->systemType !== null) {
			
			$xfer += $output->writeFieldBegin('systemType');
			$xfer += $output->writeI32($this->systemType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->fromSource !== null) {
			
			$xfer += $output->writeFieldBegin('fromSource');
			$xfer += $output->writeString($this->fromSource);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->fromChannel !== null) {
			
			$xfer += $output->writeFieldBegin('fromChannel');
			$xfer += $output->writeString($this->fromChannel);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->id !== null) {
			
			$xfer += $output->writeFieldBegin('id');
			$xfer += $output->writeI64($this->id);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->vipcardProductCode !== null) {
			
			$xfer += $output->writeFieldBegin('vipcardProductCode');
			$xfer += $output->writeI32($this->vipcardProductCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->activateCodeEncrypt !== null) {
			
			$xfer += $output->writeFieldBegin('activateCodeEncrypt');
			$xfer += $output->writeString($this->activateCodeEncrypt);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->sellTime !== null) {
			
			$xfer += $output->writeFieldBegin('sellTime');
			$xfer += $output->writeI64($this->sellTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->merchantName !== null) {
			
			$xfer += $output->writeFieldBegin('merchantName');
			$xfer += $output->writeString($this->merchantName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->merchantCode !== null) {
			
			$xfer += $output->writeFieldBegin('merchantCode');
			$xfer += $output->writeString($this->merchantCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->createTime !== null) {
			
			$xfer += $output->writeFieldBegin('createTime');
			$xfer += $output->writeI64($this->createTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->useEffectDay !== null) {
			
			$xfer += $output->writeFieldBegin('useEffectDay');
			$xfer += $output->writeI32($this->useEffectDay);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->groupId !== null) {
			
			$xfer += $output->writeFieldBegin('groupId');
			$xfer += $output->writeI32($this->groupId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->orderSn !== null) {
			
			$xfer += $output->writeFieldBegin('orderSn');
			$xfer += $output->writeString($this->orderSn);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->activityId !== null) {
			
			$xfer += $output->writeFieldBegin('activityId');
			$xfer += $output->writeString($this->activityId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->activityNo !== null) {
			
			$xfer += $output->writeFieldBegin('activityNo');
			$xfer += $output->writeString($this->activityNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->cardFlag !== null) {
			
			$xfer += $output->writeFieldBegin('cardFlag');
			$xfer += $output->writeI32($this->cardFlag);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->purchaserId !== null) {
			
			$xfer += $output->writeFieldBegin('purchaserId');
			$xfer += $output->writeI64($this->purchaserId);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->status !== null) {
			
			$xfer += $output->writeFieldBegin('status');
			$xfer += $output->writeI32($this->status);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->revokeMoney !== null) {
			
			$xfer += $output->writeFieldBegin('revokeMoney');
			$xfer += $output->writeString($this->revokeMoney);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->activateEndTime !== null) {
			
			$xfer += $output->writeFieldBegin('activateEndTime');
			$xfer += $output->writeI64($this->activateEndTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->showVipcardStatus !== null) {
			
			$xfer += $output->writeFieldBegin('showVipcardStatus');
			$xfer += $output->writeI32($this->showVipcardStatus);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>